var express = require('express')
const multer  = require('multer')
const upload = multer({ dest: 'public/uploads/' })
const StudentController = require('../controller/StudentController')
var StudentRouter = express.Router()
StudentRouter.get("/admin/students",StudentController.getList)
StudentRouter.post("/admin/students",StudentController.addList)
StudentRouter.post("/admin/students/login",StudentController.login)
StudentRouter.post("/admin/students/:id/upload",upload.single('file'/*与前端定义的字段相同*/),StudentController.upload)
StudentRouter.delete("/admin/students/:id",StudentController.deleteList)
StudentRouter.put("/admin/students/:id",StudentController.updateList)
module.exports = StudentRouter